import java.util.Scanner;

public class demo2 {
    public static void Mousemove(String num1, String s) {
        int num = Integer.parseInt(num1);
        int start = 1;
        int mouse = 1;
        if (num <= 4) {
            for (int i = 0; i < s.length(); i++) {
                if (mouse == 1 && s.charAt(i) == 'U') {
                    mouse = num;
                } else if (mouse == num && s.charAt(i) == 'D') {
                    mouse = 1;
                } else if (s.charAt(i) == 'U') {
                    mouse = mouse - 1;
                } else if (s.charAt(i) == 'D') {
                    mouse = mouse + 1;
                }
            }
            for (int i = start; i <= num; i ++) {
                System.out.print(i + " ");
            }
            System.out.println();
            System.out.println(mouse);
        } else {
            for (int i = 0; i < s.length(); i++) {
                if (mouse == 1 && start == 1 && s.charAt(i) == 'U') {
                    mouse = num;
                    start = num - 3;
                } else if (mouse == num && start == num - 3 && s.charAt(i) == 'D') {
                    mouse = 1;
                    start = 1;
                } else if (start != 1 && mouse == start && s.charAt(i) == 'U') {
                    mouse = mouse - 1;
                    start = start - 1;
                } else if ( start == mouse - 3 && s.charAt(i) == 'D') {
                    mouse = mouse + 1;
                    start = start + 1;
                } else if (s.charAt(i) == 'U') {
                    mouse = mouse - 1;
                } else if (s.charAt(i) == 'D') {
                    mouse = mouse + 1;
                }
            }
            for (int i = start; i < start + 4; i ++) {
                System.out.print(i + " ");
            }
            System.out.println();
            System.out.println(mouse);
        }
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String num = scan.nextLine();
        String s = scan.nextLine();
        Mousemove(num, s);
    }
}
